@echo off

echo Setting up environment for Qt usage...
set PATH=%QTDIR%\bin;%PATH%

if exist "C:\Programme\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" (
	call "C:\Programme\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
	goto start
)
if exist "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" (
	call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
	goto start
)
if exist "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" (
	call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
	goto start
)

echo Visual Studio Umgebung nicht gefunden!
goto ende

:start

rem set /p VERSION=<version.txt
rem set VERSION=%VERSION:.=_%
set TARGET="C:\Program Files (x86)\pio"

qmake
nmake release
mkdir %TARGET%\
mkdir %TARGET%\plugins\
del /Q /S "%TARGET%"
copy bin\*.* %TARGET%
copy bin\plugins\*.dll %TARGET%\plugins
copy bin\*.qm %TARGET%
nmake distclean
del /Q /S bin
rmdir bin\plugins
rmdir bin

:ende
